<?php
// 通用文件，包括配置、Xiaonei初始化等
require_once './common.php';
?>

<!-- 创建一组标准的 Xiaonei 标签导航栏。 -->
<div id="sub-nav">
<ul>
  <li style="padding-right:10px;"><a href="<? echo $config['app_app_url'] ?>index.php">送礼给他/她</a></li>
  <li style="padding-right:10px;"><a href="<? echo $config['app_app_url'] ?>send.php">送出的礼物</a></li>
  <li style="padding-right:10px;" class="selected"><a href="<? echo $config['app_app_url'] ?>receive.php">接收的礼物</a></li>
  <li style="padding-right:10px;"><a href="<? echo $config['app_app_url'] ?>invite.php">邀请好友加入</a></li>
  <li style="padding-right:10px;"><a href="<? echo $config['app_app_url'] ?>mine.php">我的账户</a></li>
</ul>
</div>

<div id="content">
<?php
if ($data = get_flowers(null, $uid)) {
  $str ='          <div style="width: 95%;    margin: 20px auto; font-size: 12px;">'."\n";
  $str.='            <h2 style="border-bottom: 1px solid #cccccc;    color: #333333;    font-size: 14px;    margin: 10px 0pt 10px;    padding: 5px;">'."\n";
  $str.='              您收到的礼物'."\n";
  $str.='            </h2>'."\n";
  $str.='            <ul style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">'."\n";
  foreach ($data as $item) {
    $str.='              <li style="list-style-image: none;    list-style-position: outside;    list-style-type: none;    padding: 5px 15px 5px 5px;    position: relative;    border-bottom: 1px solid #ECF1F3;">'."\n";
    $str.='                <div style="float: left;    width: 48px;    border: none;    padding: 0;    margin: 0;">'."\n";
    $str.='                  <img src="' . $config['app_url'] . 'images/flowers/' . $item['flower'] . '.jpg" border="0" />'."\n";
    $str.='                  <p style="text-align: center; padding: 3px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">'."\n";
    $str.='                    <strong>' . $config['flowers'][$item['flower']] . '</strong>'."\n";
    $str.='                  </p>'."\n";
    $str.='                </div>'."\n";
    $str.='                <div style="padding: 0;    margin: 0 0 0 62px;">'."\n";
    $str.='                  <span style="color: #999; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; margin-top: 4px;">送出人：</span><yk:name uid="' . $item['from'] . '" linked="true" />'."\n";
    $str.='                  <p style="color: #999; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; margin-top: 4px;">'."\n";
    $str.='                    <span>时间：</span>' . date('Y-m-d H:i:s', $item['time']) . "\n";
    $str.='                  </p>'."\n";
    $str.='                  <p style="color: #999; margin-bottom: 4px; margin-left: 4px; margin-right: 4px; margin-top: 4px;">'."\n";
    $str.='                    <span>赠言：</span>' . $item['message'] . "\n";
    $str.='                  </p>'."\n";
    $str.='                </div>'."\n";
    $str.='                <div style=" clear: both;"></div>'."\n";
    $str.='              </li>             ';
  }
  $str.='            </ul>'."\n";
  $str.='          </div>';
  echo $str;
} else {
  echo message_box('友情提示', '还没有人给你送礼物哦。', 'explanation');
}

?>

</div>
